<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app"></div>

  <template id="my-app">
    <input type="text" v-model="message">
    <h2>{{message}}</h2>

    <h2>{{title}}</h2>
    <p>{{desc}}</p>
    <button @click="btnClick">按钮点击</button>

  </template>

  <script src="../js/vue.js"></script>
  <script>
    const App = {
      template: "#my-app",
      data() {
        return {
          message: "Hello World",
          title: "哈哈哈",
          desc: "我是内容，哈哈哈",
        }
      },
      methods: {
        btnClick() {
          console.log("按钮发生点击");
        },
      }
    };

    Vue.createApp(App).mount("#app");
  </script>
</body>

</html>